package com.mostromas.ess.inventory.controller;

import com.mostromas.ess.inventory.req.StockDetailedREQ;
import com.mostromas.ess.inventory.service.IStockDetailedService;
import com.mostromas.ess.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 库存明细表-前端控制器
 */
@Api(value = "库存明细管理接口",description = "库存明细管理接口，提供库存明细的增、删、改、查")
@RestController //所有方法都会返回json字符串进行相应
@RequestMapping("/stock")
public class StockDetailedController {

    @Autowired
    private IStockDetailedService stockDetailedService;

    @PreAuthorize(("hasAuthority('stock:search')"))
    @ApiOperation("根据款式类别ID、款式ID、所在仓库查询库存明细接口")
    @PostMapping("/search")
    public Result search(@RequestBody StockDetailedREQ req){
        return stockDetailedService.queryPage(req);
    }

}
